##
rm(list = ls())
load('ACT.RData')
load('CT.RData')
library(ggplot2)

ac = apply(ACtime, 2, median)
fc = apply(Ctime, 2, median)
ac_max = apply(ACtime, 2, max)

df = data.frame(time = c(log(ac ), log(ac_max) ,log(fc )), 
                Method = c(rep("Shortcut (median)", 100),rep("Shortcut (max)", 100) ,rep("Full CTGT",19) ), 
                by = factor(c(seq.int(2,200,2),seq.int(2,200,2), seq.int(2,38,2)) ) )

jpeg("time.jpg", width = 12, height = 10, units = 'cm', res = 600)
ggplot(df, aes(x = by, y=time, group = Method)) + 
  geom_line(aes(linetype=Method)) +
  theme_minimal()+ 
  theme(legend.position="bottom")+
  xlab("Number of features") +
  ylab("Computaion time")+
  scale_y_continuous(breaks=c(log(0.002),log(1), log(60), log(600),log(1800), log(3600)), labels = c("2ms", "1s", "1m", "10m", "30m", "1h") )+
  scale_x_discrete(breaks=factor(c(10,50,100,150,200)), labels = c(10,50,100,150,200) )

dev.off()


